﻿using Abp.Application.Services.Dto;
using SingleUserMall.Common;
using SingleUserMall.Orders.Form;
using SingleUserMall.Orders.VO;
using SingleUserMall.Users.VO;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SingleUserMall.Orders
{
    /// <summary>
    /// 订单
    /// </summary>
    [Description("订单")]
    public interface IOrderAppService : IAppService
    {
        /// <summary>
        /// 获取订单列表
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<PagedResultDto<OrderMiniVO>> GetOrdersAsync(OrderPagedForm form);

        /// <summary>
        /// 获取果树订单列表
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<PagedResultDto<OrderDividendMiniVO>> GetTreeOrdersAsync(OrderPagedForm form);
        /// <summary>
        /// 获取订单详情
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> GetOrderAsync(SingleId<long> form);
    
        /// <summary>
        /// 选择配送方式
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> SetOrderShippingAsync(OrderShippingForm form);
        /// <summary>
        /// 支付
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> PayAsync(OrderPayForm form);
        /// <summary>
        /// 取消订单
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task CancelAsync(SingleId<long> form);
        /// <summary>
        /// 根据现有订单再来一单
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> NewOrderAsync(SingleId<long> form);
        /// <summary>
        /// 获取用户送货地址
        /// </summary>
        /// <returns></returns>
        Task<ListResultDto<UserAddressVO>> GetUserAddressesAsync();
        /// <summary>
        /// 获取用户朋友的地址
        /// </summary>
        /// <returns></returns>
        Task<ListResultDto<UserAddressVO>> GetUserFriendAddressesAsync();
        /// <summary>
        /// 保存送货地址
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<ListResultDto<UserAddressVO>> SaveUserAddressAsync(UserAddressForm form);
        /// <summary>
        /// 确认收货
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task ConfirmGetAsync(SingleId<long> form);
        /// <summary>
        /// 移除送货地址
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<ListResultDto<UserAddressVO>> RemoveUserAddressAsync(SingleId<long> form);
        /// <summary>
        /// 设置默认送货地址
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<ListResultDto<UserAddressVO>> SetDefaultUserAddressAsync(SingleId<long> form);

        /// <summary>
        /// 设置是否选中包装费
        /// </summary>
        /// <param name="form"></param>             
        /// <returns></returns>
        Task SetDefaultPackPriceAsync(PackPriceForm form);
        /// <summary>
        /// 评论订单
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task CommentAsync(OrderCommentForm form);
        /// <summary>
        /// 根据groupOrderId获取团购信息
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<GroupOrderVO> GetGroupOrderAsync(SingleId<long> form);
        /// <summary>
        /// 根据orderId获取团购信息
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<GroupOrderVO> GetGroupOrderByOrderIdAsync(SingleId<long> form);
        /// <summary>
        /// 根据orderId获取物流信息
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> GetOrderLogisticsAsync(SingleId<long> form);

        /// <summary>
        /// 获取购买记录
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<PagedResultDto<UserBuyDetailVO>> GetUserBuysAsync(OrderTreePagedForm form);

        /// <summary>
        /// 获取用户分红记录
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<PagedResultDto<UserDividendsAmountVO>> GetAllUserDividendAsync(ItemDividedForm form);

    }
}
